<template>
	<view>
		<view style="padding-top: 300rpx; padding-left: 80rpx;">
			<view style="font-size: 42rpx;font-weight: bold; width: 210rpx; border-bottom: 10rpx solid #434E7E;">渠道端登录</view>
		</view>
		<view style="padding: 0rpx 100rpx; margin-top: 100rpx">
			<form @submit="formSubmit">
				<input type="text" name="account" placeholder="请输入账号" style="border-bottom: 2rpx solid #F8F9FA; padding: 20rpx 0rpx" />
				<input type="password" name="password" placeholder="请输入密码" style="border-bottom: 2rpx solid #F8F9FA; padding: 20rpx 0rpx; margin-top: 30rpx" />
				<button type="primary" form-type="submit" style="margin-top: 80rpx; width: 100%; background-color: #434E7E; border-radius: 50rpx; font-size: 36rpx">登录</button>
			</form>
		</view>
	</view>
</template>

<script>
	import * as api from '@/api/channel'
	import storage from '@/utils/storage'
	export default {
		data() {
			return {
				
			};
		},
		onLoad(option) {

		},
		methods: {
			// 提交表单
			formSubmit: function (form) {
				api.login({
					account: form.detail.value.account,
					password: form.detail.value.password
				}).then(res => {
					storage.set('channelId', res.data.id, 86400);
					uni.redirectTo({ url: '/pages/channel/dataList' });
				});
				console.log(form.detail.value);
			}
		}
	}
</script>
<style>
</style>